<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>Actions Plugin</title>
<link href="../docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
		<meta name="viewport" content="width=device-width initial-scale=1">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="Content-Language" content="en-gb">

<link href="../docs-assets/Contents.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Progress.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Navigation.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Fonts.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Base.css" rel="stylesheet" rev="stylesheet" type="text/css">
<script>
function togglePopup(material_id) {
  var popup = document.getElementById(material_id);
  popup.classList.toggle("show");
}
</script>

<link href="../docs-assets/Popups.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
		
	</head>
	<body class="commentary-font">
		<nav role="navigation">
		<h1><a href="../index.html"><img src="../docs-assets/Inform.png" height=72> </a></h1>
<ul><li><a href="../index.html">home</a></li>
</ul><h2>Compiler</h2><ul>
<li><a href="../structure.html">structure</a></li>
<li><a href="../inbuildn.html">inbuild</a></li>
<li><a href="../inform7n.html">inform7</a></li>
<li><a href="../intern.html">inter</a></li>
<li><a href="../services.html">services</a></li>
<li><a href="../secrets.html">secrets</a></li>
</ul><h2>Other Tools</h2><ul>
<li><a href="../inblorbn.html">inblorb</a></li>
<li><a href="../inform6.html">inform6</a></li>
<li><a href="../inpolicyn.html">inpolicy</a></li>
</ul><h2>Resources</h2><ul>
<li><a href="../extensions.html">extensions</a></li>
<li><a href="../kits.html">kits</a></li>
</ul><h2>Repository</h2><ul>
<li><a href="https://github.com/ganelson/inform"><img src="../docs-assets/github.png" height=0> github</a></li>
</ul><h2>Related Projects</h2><ul>
<li><a href="https://github.com/ganelson/inweb"><img src="../docs-assets/github.png" height=0> inweb</a></li>
<li><a href="https://github.com/ganelson/intest"><img src="../docs-assets/github.png" height=0> intest</a></li>
</ul>
		</nav>
		<main role="main">
		<!-- Weave of 'Actions Plugin' generated by inweb -->
<div class="breadcrumbs">
    <ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="../inform7n.html">Inform7</a></li><li><a href="index.html">if</a></li><li><a href="index.html#4">Chapter 4: Actions</a></li><li><b>Actions Plugin</b></li></ul></div>
<p class="purpose">A feature for actions, by which animate characters change the world model.</p>

<p class="commentary firstcommentary"><a id="SP1" class="paragraph-anchor"></a><b>&#167;1. </b>Support for actions is contained in the "actions" feature, which occupies this
entire chapter. The test group <span class="extract"><span class="extract-syntax">:actions</span></span> may be helpful in trouble-shooting here.
</p>

<p class="commentary">It may be helpful to distinguish these ideas right from the outset:
</p>

<ul class="items"><li>&#9679; An "action" (or "explicit action", for the sake of clarity) is a specific
impulse by a person in the model world to effect some change within it: for
example, "Henry taking the brick". Here Henry is the "actor", and the brick is
"the noun". Actions can be "stored" so that they are values in their own
right; thus, a variable could be set to the value "Henry taking the brick",
and this would have kind <span class="extract"><span class="extract-syntax">K_stored_action</span></span>. Inside the compiler they are
represented by <a href="4-ea.html#SP1" class="internal">explicit_action</a> objects.
</li><li>&#9679; An "action name" &mdash; not an ideal thing to call it, but traditional &mdash; is the
type of action involved, taken in isolation: for example, "taking". These can
also be values at run-time, they have kind <span class="extract"><span class="extract-syntax">K_action_name</span></span>, and they are
represented in the compiler by <a href="4-act.html#SP1" class="internal">action_name</a> objections.
</li><li>&#9679; An "action pattern" is a textual description which matches some actions but
not others, and can be vague or specific: for example, "wearing or examining
something". Action patterns become values of the kind <span class="extract"><span class="extract-syntax">K_description_of_action</span></span>.
They can also be aggregated into "named action patterns", which characterise
behaviour; see <a href="4-ap2.html#SP3" class="internal">action_pattern</a> and <a href="4-nap.html#SP1" class="internal">named_action_pattern</a>.
</li><li>&#9679; A "past action pattern", which can never in any way be a value, is a
description of an action which may have happened in the past: for example,
"dropped the hat". These are just a special case of action patterns.
</li></ul>
<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">ActionsPlugin::start</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">ActionsPlugin::start</span></span>:<br/>IF Module - <a href="1-im.html#SP5">&#167;5</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">void</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><a href="4-anaa.html#SP2" class="function-link"><span class="function-syntax">ActionsNodes::nodes_and_annotations</span></a><span class="plain-syntax">();</span>

<span class="plain-syntax">#</span><span class="identifier-syntax">pragma</span><span class="plain-syntax"> </span><span class="identifier-syntax">clang</span><span class="plain-syntax"> </span><span class="identifier-syntax">diagnostic</span><span class="plain-syntax"> </span><span class="identifier-syntax">push</span>
<span class="plain-syntax">#</span><span class="identifier-syntax">pragma</span><span class="plain-syntax"> </span><span class="identifier-syntax">clang</span><span class="plain-syntax"> </span><span class="identifier-syntax">diagnostic</span><span class="plain-syntax"> </span><span class="identifier-syntax">ignored</span><span class="plain-syntax"> </span><span class="string-syntax">"-Wincompatible-function-pointer-types-strict"</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">PluginCalls::plug</span><span class="plain-syntax">(</span><span class="identifier-syntax">MAKE_SPECIAL_MEANINGS_PLUG</span><span class="plain-syntax">, </span><a href="4-ap.html#SP7" class="function-link"><span class="function-syntax">ActionsPlugin::make_special_meanings</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">PluginCalls::plug</span><span class="plain-syntax">(</span><span class="identifier-syntax">NEW_BASE_KIND_NOTIFY_PLUG</span><span class="plain-syntax">, </span><a href="4-ak.html#SP2" class="function-link"><span class="function-syntax">ARvalues::new_base_kind_notify</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">PluginCalls::plug</span><span class="plain-syntax">(</span><span class="identifier-syntax">COMPARE_CONSTANT_PLUG</span><span class="plain-syntax">, </span><a href="4-ak.html#SP7" class="function-link"><span class="function-syntax">ARvalues::compare_CONSTANT</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">PluginCalls::plug</span><span class="plain-syntax">(</span><span class="identifier-syntax">COMPILE_CONSTANT_PLUG</span><span class="plain-syntax">, </span><span class="identifier-syntax">CompileRvalues::action_kinds</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">PluginCalls::plug</span><span class="plain-syntax">(</span><span class="identifier-syntax">COMPILE_CONDITION_PLUG</span><span class="plain-syntax">, </span><a href="4-ac.html#SP3" class="function-link"><span class="function-syntax">AConditions::compile_condition</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">PluginCalls::plug</span><span class="plain-syntax">(</span><span class="identifier-syntax">CREATION_PLUG</span><span class="plain-syntax">, </span><a href="4-anaa.html#SP7" class="function-link"><span class="function-syntax">ActionsNodes::creation</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">PluginCalls::plug</span><span class="plain-syntax">(</span><span class="identifier-syntax">UNUSUAL_PROPERTY_VALUE_PLUG</span><span class="plain-syntax">, </span><a href="4-anaa.html#SP8" class="function-link"><span class="function-syntax">ActionsNodes::unusual_property_value_node</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">PluginCalls::plug</span><span class="plain-syntax">(</span><span class="identifier-syntax">OFFERED_PROPERTY_PLUG</span><span class="plain-syntax">, </span><a href="4-av.html#SP1" class="function-link"><span class="function-syntax">ActionVariables::actions_offered_property</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">PluginCalls::plug</span><span class="plain-syntax">(</span><span class="identifier-syntax">OFFERED_SPECIFICATION_PLUG</span><span class="plain-syntax">, </span><a href="4-ap.html#SP5" class="function-link"><span class="function-syntax">ActionsPlugin::actions_offered_specification</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">PluginCalls::plug</span><span class="plain-syntax">(</span><span class="identifier-syntax">TYPECHECK_EQUALITY_PLUG</span><span class="plain-syntax">, </span><a href="4-ak.html#SP3" class="function-link"><span class="function-syntax">ARvalues::actions_typecheck_equality</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">PluginCalls::plug</span><span class="plain-syntax">(</span><span class="identifier-syntax">PLACE_RULE_PLUG</span><span class="plain-syntax">, </span><a href="4-act.html#SP5" class="function-link"><span class="function-syntax">Actions::place_rule</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">PluginCalls::plug</span><span class="plain-syntax">(</span><span class="identifier-syntax">RULE_PLACEMENT_NOTIFY_PLUG</span><span class="plain-syntax">, </span><a href="4-act.html#SP6" class="function-link"><span class="function-syntax">Actions::rule_placement_notify</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">PluginCalls::plug</span><span class="plain-syntax">(</span><span class="identifier-syntax">PRODUCTION_LINE_PLUG</span><span class="plain-syntax">, </span><a href="4-ap.html#SP1" class="function-link"><span class="function-syntax">ActionsPlugin::production_line</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">PluginCalls::plug</span><span class="plain-syntax">(</span><span class="identifier-syntax">COMPLETE_MODEL_PLUG</span><span class="plain-syntax">, </span><a href="4-ap.html#SP6" class="function-link"><span class="function-syntax">ActionsPlugin::complete_model</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">PluginCalls::plug</span><span class="plain-syntax">(</span><span class="identifier-syntax">COMPILE_TEST_HEAD_PLUG</span><span class="plain-syntax">, </span><span class="identifier-syntax">RTRules::actions_compile_test_head</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">PluginCalls::plug</span><span class="plain-syntax">(</span><span class="identifier-syntax">COMPILE_TEST_TAIL_PLUG</span><span class="plain-syntax">, </span><span class="identifier-syntax">RTRules::actions_compile_test_tail</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">PluginCalls::plug</span><span class="plain-syntax">(</span><span class="identifier-syntax">NEW_RCD_NOTIFY_PLUG</span><span class="plain-syntax">, </span><a href="4-rpoa.html#SP2" class="function-link"><span class="function-syntax">ActionRules::new_rcd</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">#</span><span class="identifier-syntax">pragma</span><span class="plain-syntax"> </span><span class="identifier-syntax">clang</span><span class="plain-syntax"> </span><span class="identifier-syntax">diagnostic</span><span class="plain-syntax"> </span><span class="identifier-syntax">pop</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">Vocabulary::set_flags</span><span class="plain-syntax">(</span><span class="identifier-syntax">Vocabulary::entry_for_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">U</span><span class="string-syntax">"doing"</span><span class="plain-syntax">), </span><span class="identifier-syntax">ACTION_PARTICIPLE_MC</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Vocabulary::set_flags</span><span class="plain-syntax">(</span><span class="identifier-syntax">Vocabulary::entry_for_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">U</span><span class="string-syntax">"asking"</span><span class="plain-syntax">), </span><span class="identifier-syntax">ACTION_PARTICIPLE_MC</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">ActionsPlugin::production_line</span><span class="plain-syntax">(</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">stage</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">debugging</span><span class="plain-syntax">, </span><span class="identifier-syntax">stopwatch_timer</span><span class="plain-syntax"> *</span><span class="identifier-syntax">sequence_timer</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">stage</span><span class="plain-syntax"> == </span><span class="identifier-syntax">INTER1_CSEQ</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">BENCH</span><span class="plain-syntax">(</span><span class="identifier-syntax">RTActions::compile</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">BENCH</span><span class="plain-syntax">(</span><span class="identifier-syntax">RTNamedActionPatterns::compile</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP2" class="paragraph-anchor"></a><b>&#167;2. </b>Though <span class="extract"><span class="extract-syntax">K_action_name</span></span> is very like an enumeration kind, its possible values,
which correspond to <a href="4-act.html#SP1" class="internal">action_name</a> objects, are not strictly speaking instances
in the Inform world model. (Because they do not have properties: see <a href="4-av.html" class="internal">Action Variables</a>
for what they have instead.)
</p>

<p class="commentary">The "waiting" action is sacred, because it is the default value for
<span class="extract"><span class="extract-syntax">K_action_name</span></span> values: waiting is the zero of actions.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">action_name</span><span class="plain-syntax"> *</span><span class="identifier-syntax">waiting_action</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
</pre>
<p class="commentary firstcommentary"><a id="SP3" class="paragraph-anchor"></a><b>&#167;3. </b>This is recognised by its English name when defined by the Standard Rules.
(So there is no need to translate this to other languages.)
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="function-syntax">&lt;waiting-action&gt;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">waiting</span>
</pre>
<p class="commentary firstcommentary"><a id="SP4" class="paragraph-anchor"></a><b>&#167;4. </b>Because <a href="4-act.html#SP1" class="internal">action_name</a> values are not instances, we cannot recognise them
when instances are created, and instead have to do it directly when this is
called by the function creating them:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">ActionsPlugin::notice_new_action_name</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">ActionsPlugin::notice_new_action_name</span></span>:<br/>Action Name Names - <a href="4-ann.html#SP3">&#167;3</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">action_name</span><span class="plain-syntax"> *</span><span class="identifier-syntax">an</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="function-syntax">&lt;waiting-action&gt;</span><span class="plain-syntax">(</span><a href="4-ann.html#SP5" class="function-link"><span class="function-syntax">ActionNameNames::tensed</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">an</span><span class="plain-syntax">, </span><span class="identifier-syntax">IS_TENSE</span><span class="plain-syntax">))) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">waiting_action</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="identifier-syntax">waiting_action</span><span class="plain-syntax"> = </span><span class="identifier-syntax">an</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">PluginCalls::new_action_notify</span><span class="plain-syntax">(</span><span class="identifier-syntax">an</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">action_name</span><span class="plain-syntax"> *</span><span class="function-syntax">ActionsPlugin::default_action_name</span><span class="plain-syntax">(</span><span class="reserved-syntax">void</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">waiting_action</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="identifier-syntax">internal_error</span><span class="plain-syntax">(</span><span class="string-syntax">"wait action not ready"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">waiting_action</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP5" class="paragraph-anchor"></a><b>&#167;5. </b>And because <span class="extract"><span class="extract-syntax">K_action_name</span></span> values have no properties, they cannot store
a "specification" text as one, and have to make their own arrangements:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">ActionsPlugin::actions_offered_specification</span><button class="popup" onclick="togglePopup('usagePopup3')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup3">Usage of <span class="code-font"><span class="function-syntax">ActionsPlugin::actions_offered_specification</span></span>:<br/><a href="4-ap.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">owner</span><span class="plain-syntax">, </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">W</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Rvalues::is_CONSTANT_of_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">owner</span><span class="plain-syntax">, </span><span class="identifier-syntax">K_action_name</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">RTActions::actions_set_specification_text</span><span class="plain-syntax">(</span>
<span class="plain-syntax">            </span><a href="4-ak.html#SP4" class="function-link"><span class="function-syntax">ARvalues::to_action_name</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">owner</span><span class="plain-syntax">), </span><span class="identifier-syntax">Wordings::first_wn</span><span class="plain-syntax">(</span><span class="identifier-syntax">W</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP6" class="paragraph-anchor"></a><b>&#167;6. </b>The action bitmap is an array of bits attached to each object, one
for each action, which records whether that action has yet applied
successfully to that object. This is used at run-time to handle past
tense conditions such as "the jewels have been taken".
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">property</span><span class="plain-syntax"> *</span><span class="identifier-syntax">P_action_bitmap</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>

<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">ActionsPlugin::complete_model</span><button class="popup" onclick="togglePopup('usagePopup4')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup4">Usage of <span class="code-font"><span class="function-syntax">ActionsPlugin::complete_model</span></span>:<br/><a href="4-ap.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">stage</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">stage</span><span class="plain-syntax"> == </span><span class="identifier-syntax">WORLD_STAGE_V</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">P_action_bitmap</span><span class="plain-syntax"> = </span><span class="identifier-syntax">ValueProperties::new_nameless</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"action_bitmap"</span><span class="plain-syntax">, </span><span class="identifier-syntax">K_value</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Hierarchy::make_available</span><span class="plain-syntax">(</span><span class="identifier-syntax">RTProperties::iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">P_action_bitmap</span><span class="plain-syntax">));</span>

<span class="plain-syntax">        </span><span class="identifier-syntax">instance</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">LOOP_OVER_INSTANCES</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">K_object</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">inference_subject</span><span class="plain-syntax"> *</span><span class="identifier-syntax">subj</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Instances::as_subject</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="named-paragraph-container code-font"><a href="4-ap.html#SP6_1" class="named-paragraph-link"><span class="named-paragraph">Assert the Inter action-bitmap property</span><span class="named-paragraph-number">6.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inference_subject</span><span class="plain-syntax"> *</span><span class="identifier-syntax">subj</span><span class="plain-syntax"> = </span><span class="identifier-syntax">KindSubjects::from_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_thing</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="4-ap.html#SP6_1" class="named-paragraph-link"><span class="named-paragraph">Assert the Inter action-bitmap property</span><span class="named-paragraph-number">6.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP6_1" class="paragraph-anchor"></a><b>&#167;6.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Assert the Inter action-bitmap property</span><span class="named-paragraph-number">6.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">K_room</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) ||</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">InferenceSubjects::is_within</span><span class="plain-syntax">(</span><span class="identifier-syntax">subj</span><span class="plain-syntax">, </span><span class="identifier-syntax">KindSubjects::from_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_room</span><span class="plain-syntax">)) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">S</span><span class="plain-syntax"> = </span><span class="identifier-syntax">RTActionBitmaps::compile_action_bitmap_property</span><span class="plain-syntax">(</span><span class="identifier-syntax">subj</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">ValueProperties::assert</span><span class="plain-syntax">(</span><span class="identifier-syntax">P_action_bitmap</span><span class="plain-syntax">, </span><span class="identifier-syntax">subj</span><span class="plain-syntax">, </span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">CERTAIN_CE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-ap.html#SP6">&#167;6</a> (twice).</li></ul>
<p class="commentary firstcommentary"><a id="SP7" class="paragraph-anchor"></a><b>&#167;7. </b>The rest of this section is given over to the Preform grammar for dealing
with the special meaning "X is an action...", which creates new action names.
These can be quite complicated:
</p>

<blockquote>
    <p>Inserting it into is an action applying to two things.</p>
</blockquote>

<blockquote>
    <p>Verifying the story file is an action out of world and applying to nothing.</p>
</blockquote>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">ActionsPlugin::make_special_meanings</span><button class="popup" onclick="togglePopup('usagePopup5')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup5">Usage of <span class="code-font"><span class="function-syntax">ActionsPlugin::make_special_meanings</span></span>:<br/><a href="4-ap.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">void</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">SpecialMeanings::declare</span><span class="plain-syntax">(</span><a href="4-ap.html#SP7" class="function-link"><span class="function-syntax">ActionsPlugin::new_action_SMF</span></a><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"new-action"</span><span class="plain-syntax">, </span><span class="constant-syntax">2</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">action_name</span><span class="plain-syntax"> *</span><span class="identifier-syntax">an_being_parsed</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">ActionsPlugin::new_action_SMF</span><span class="plain-syntax">(</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">task</span><span class="plain-syntax">, </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">V</span><span class="plain-syntax">, </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> *</span><span class="identifier-syntax">NPs</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">SW</span><span class="plain-syntax"> = (</span><span class="identifier-syntax">NPs</span><span class="plain-syntax">)?(</span><span class="identifier-syntax">NPs</span><span class="plain-syntax">[0]):</span><span class="identifier-syntax">EMPTY_WORDING</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">OW</span><span class="plain-syntax"> = (</span><span class="identifier-syntax">NPs</span><span class="plain-syntax">)?(</span><span class="identifier-syntax">NPs</span><span class="plain-syntax">[1]):</span><span class="identifier-syntax">EMPTY_WORDING</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">switch</span><span class="plain-syntax"> (</span><span class="identifier-syntax">task</span><span class="plain-syntax">) { </span><span class="comment-syntax"> "Taking something is an action."</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">ACCEPT_SMFT:</span><span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="4-ap.html#SP7_1" class="named-paragraph-link"><span class="named-paragraph">Check that this validly declares an action</span><span class="named-paragraph-number">7.1</span></a></span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">PASS_1_SMFT:</span><span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="4-ap.html#SP7_2" class="named-paragraph-link"><span class="named-paragraph">Parse the subject and object phrases</span><span class="named-paragraph-number">7.2</span></a></span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP7_1" class="paragraph-anchor"></a><b>&#167;7.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Check that this validly declares an action</span><span class="named-paragraph-number">7.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="function-syntax">&lt;new-action-sentence-object&gt;</span><span class="plain-syntax">(</span><span class="identifier-syntax">OW</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="function-syntax">&lt;&lt;r&gt;&gt;</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">O</span><span class="plain-syntax"> = </span><span class="function-syntax">&lt;&lt;rp&gt;&gt;</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="function-syntax">&lt;np-unparsed&gt;</span><span class="plain-syntax">(</span><span class="identifier-syntax">SW</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">V</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next</span><span class="plain-syntax"> = </span><span class="function-syntax">&lt;&lt;rp&gt;&gt;</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">V</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next</span><span class="plain-syntax"> = </span><span class="identifier-syntax">O</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-ap.html#SP7">&#167;7</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP8" class="paragraph-anchor"></a><b>&#167;8. </b>&lt;nounphrase-actionable&gt; here is an awkward necessity, designed to prevent the
regular sentence "The impulse is an action name that varies" from being parsed
as an instance of "... is an action ...", creating a new action.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="function-syntax">&lt;new-action-sentence-object&gt;</span>
<span class="plain-syntax">    </span><span class="function-syntax">&lt;indefinite-article&gt;</span><span class="plain-syntax"> </span><span class="function-syntax">&lt;new-action-sentence-object-unarticled&gt;</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="function-syntax">&lt;new-action-sentence-object-unarticled&gt;</span>

<span class="function-syntax">&lt;new-action-sentence-object-unarticled&gt;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">action</span><span class="plain-syntax"> </span><span class="identifier-syntax">based</span><span class="plain-syntax"> ... |</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">action</span><span class="plain-syntax"> </span><span class="function-syntax">&lt;nounphrase-actionable&gt;</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">action</span>

<span class="function-syntax">&lt;nounphrase-actionable&gt;</span>
<span class="plain-syntax">    ^</span><span class="function-syntax">&lt;variable-creation-tail&gt;</span>

<span class="function-syntax">&lt;variable-creation-tail&gt;</span>
<span class="plain-syntax">    *** </span><span class="identifier-syntax">that</span><span class="plain-syntax">/</span><span class="identifier-syntax">which</span><span class="plain-syntax"> </span><span class="identifier-syntax">vary</span><span class="plain-syntax">/</span><span class="identifier-syntax">varies</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    *** </span><span class="identifier-syntax">variable</span>
</pre>
<p class="commentary firstcommentary"><a id="SP8_1" class="paragraph-anchor"></a><b>&#167;8.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Issue PM_BadActionDeclaration problem</span><span class="named-paragraph-number">8.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">UsingProblems::assertion_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_BadActionDeclaration</span><span class="plain-syntax">),</span>
<span class="plain-syntax">        </span><span class="string-syntax">"it is not sufficient to say that something is an 'action'"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="string-syntax">"without giving the necessary details: for example, 'Unclamping "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"is an action applying to one thing.'"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    ==&gt; { </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax"> };</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-ap.html#SP8">&#167;8</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP7_2" class="paragraph-anchor"></a><b>&#167;7.2. </b>Supposing that all that worked, the SP of the sentence is the name for the
new action, and the OP can include a wide range of details about it.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Parse the subject and object phrases</span><span class="named-paragraph-number">7.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">V</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">V</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="function-syntax">&lt;action-sentence-subject&gt;(Node::get_text(V-&gt;</span><span class="element-syntax">next</span><span class="plain-syntax">))) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">an_being_parsed</span><span class="plain-syntax"> = </span><span class="function-syntax">&lt;&lt;rp&gt;&gt;</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">an_being_parsed</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">compilation_data</span><span class="plain-syntax">.</span><span class="identifier-syntax">designers_specification</span><span class="plain-syntax"> = </span><span class="identifier-syntax">V</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><a href="4-ap.html#SP11" class="function-link"><span class="function-syntax">ActionsPlugin::clear_clauses</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><span class="function-syntax">&lt;action-sentence-object&gt;(Node::get_text(V-&gt;next-&gt;</span><span class="element-syntax">next</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-ap.html#SP7">&#167;7</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP9" class="paragraph-anchor"></a><b>&#167;9. </b>The subject noun phrase needs little further parsing &mdash; it's the name of the
action-to-be. A successful match here causes the new <a href="4-act.html#SP1" class="internal">action_name</a> structure
to be created.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="function-syntax">&lt;action-sentence-subject&gt;</span>
<span class="plain-syntax">    </span><span class="function-syntax">&lt;action-name&gt;</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    ...</span>
</pre>
<p class="commentary firstcommentary"><a id="SP9_1" class="paragraph-anchor"></a><b>&#167;9.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Issue PM_ActionAlreadyExists problem</span><span class="named-paragraph-number">9.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">StandardProblems::sentence_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(),</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_ActionAlreadyExists</span><span class="plain-syntax">),</span>
<span class="plain-syntax">        </span><span class="string-syntax">"that seems to be an action already existing"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="string-syntax">"so it cannot be redefined now. If you would like to reconfigure "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"an action in the standard set - for instance if you prefer "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"'unlocking' to apply to only one thing, not two - create a new "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"action for what you need ('keyless unlocking', perhaps) and then "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"change the grammar to use the new action rather than the old "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"('Understand \"unlock [something]\" as keyless unlocking.')."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    ==&gt; { </span><span class="identifier-syntax">fail</span><span class="plain-syntax"> </span><span class="identifier-syntax">nonterminal</span><span class="plain-syntax"> };</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-ap.html#SP9">&#167;9</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP10" class="paragraph-anchor"></a><b>&#167;10. </b>The object NP is a sequence of "action clauses" which can occur in any order,
which are allowed but not required to be delimited as a list, and which can
inconveniently contain the word "and"; not only that, but note that in
</p>

<blockquote>
    <p>applying to one thing and one number</p>
</blockquote>

<p class="commentary">the initial text "applying to one thing" would be valid as it stands.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="function-syntax">&lt;action-sentence-object&gt;</span>
<span class="plain-syntax">    </span><span class="function-syntax">&lt;action-clauses&gt;</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    ...</span>

<span class="function-syntax">&lt;action-clauses&gt;</span>
<span class="plain-syntax">    ... |</span>
<span class="plain-syntax">    </span><span class="function-syntax">&lt;action-clauses&gt;</span><span class="plain-syntax"> </span><span class="function-syntax">&lt;action-clause-terminated&gt;</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="function-syntax">&lt;action-clause-terminated&gt;</span>

<span class="function-syntax">&lt;action-clause-terminated&gt;</span>
<span class="plain-syntax">    </span><span class="function-syntax">&lt;action-clause&gt;</span><span class="plain-syntax"> , </span><span class="identifier-syntax">and</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="function-syntax">&lt;action-clause&gt;</span><span class="plain-syntax"> </span><span class="identifier-syntax">and</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="function-syntax">&lt;action-clause&gt;</span><span class="plain-syntax"> , |</span>
<span class="plain-syntax">    </span><span class="function-syntax">&lt;action-clause&gt;</span>

<span class="function-syntax">&lt;action-clause&gt;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">out</span><span class="plain-syntax"> </span><span class="identifier-syntax">of</span><span class="plain-syntax"> </span><span class="identifier-syntax">world</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">abbreviable</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">with</span><span class="plain-syntax"> </span><span class="identifier-syntax">past</span><span class="plain-syntax"> </span><span class="identifier-syntax">participle</span><span class="plain-syntax"> ... |</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">applying</span><span class="plain-syntax"> </span><span class="identifier-syntax">to</span><span class="plain-syntax"> </span><span class="function-syntax">&lt;action-applications&gt;</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">requiring</span><span class="plain-syntax"> </span><span class="identifier-syntax">light</span>

<span class="function-syntax">&lt;action-applications&gt;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">nothing</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">one</span><span class="plain-syntax"> </span><span class="function-syntax">&lt;act-req&gt;</span><span class="plain-syntax"> </span><span class="identifier-syntax">and</span><span class="plain-syntax"> </span><span class="identifier-syntax">one</span><span class="plain-syntax"> </span><span class="function-syntax">&lt;act-req&gt;</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">one</span><span class="plain-syntax"> </span><span class="function-syntax">&lt;act-req&gt;</span><span class="plain-syntax"> </span><span class="identifier-syntax">and</span><span class="plain-syntax"> </span><span class="function-syntax">&lt;act-req&gt;</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="function-syntax">&lt;act-req&gt;</span><span class="plain-syntax"> </span><span class="identifier-syntax">and</span><span class="plain-syntax"> </span><span class="identifier-syntax">one</span><span class="plain-syntax"> </span><span class="function-syntax">&lt;act-req&gt;</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="function-syntax">&lt;act-req&gt;</span><span class="plain-syntax"> </span><span class="identifier-syntax">and</span><span class="plain-syntax"> </span><span class="function-syntax">&lt;act-req&gt;</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">nothing</span><span class="plain-syntax"> </span><span class="identifier-syntax">or</span><span class="plain-syntax"> </span><span class="identifier-syntax">one</span><span class="plain-syntax"> </span><span class="function-syntax">&lt;act-req&gt;</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">one</span><span class="plain-syntax"> </span><span class="function-syntax">&lt;act-req&gt;</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">two</span><span class="plain-syntax"> </span><span class="function-syntax">&lt;act-req&gt;</span><span class="plain-syntax">   |</span>
<span class="plain-syntax">    </span><span class="function-syntax">&lt;act-req&gt;</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    ...</span>

<span class="function-syntax">&lt;act-req&gt;</span>
<span class="plain-syntax">    </span><span class="function-syntax">&lt;act-req-inner&gt;</span>

<span class="function-syntax">&lt;act-req-inner&gt;</span>
<span class="plain-syntax">    </span><span class="function-syntax">&lt;action-access&gt;</span><span class="plain-syntax"> </span><span class="function-syntax">&lt;k-kind&gt;</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="function-syntax">&lt;k-kind&gt;</span>

<span class="function-syntax">&lt;action-access&gt;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">visible</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">touchable</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">carried</span>
</pre>
<p class="commentary firstcommentary"><a id="SP10_1" class="paragraph-anchor"></a><b>&#167;10.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Make out of world</span><span class="named-paragraph-number">10.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><a href="4-as.html#SP3" class="function-link"><span class="function-syntax">ActionSemantics::make_action_out_of_world</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">an_being_parsed</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-ap.html#SP10">&#167;10</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP10_2" class="paragraph-anchor"></a><b>&#167;10.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Make abbreviable</span><span class="named-paragraph-number">10.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><a href="4-ann.html#SP8" class="function-link"><span class="function-syntax">ActionNameNames::make_abbreviable</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">an_being_parsed</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-ap.html#SP10">&#167;10</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP10_3" class="paragraph-anchor"></a><b>&#167;10.3. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Give irregular participle</span><span class="named-paragraph-number">10.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><a href="4-ann.html#SP4" class="function-link"><span class="function-syntax">ActionNameNames::set_irregular_past</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">an_being_parsed</span><span class="plain-syntax">, </span><span class="identifier-syntax">GET_RW</span><span class="plain-syntax">(</span><span class="function-syntax">&lt;action-clause&gt;</span><span class="plain-syntax">, </span><span class="constant-syntax">1</span><span class="plain-syntax">));</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-ap.html#SP10">&#167;10</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP10_4" class="paragraph-anchor"></a><b>&#167;10.4. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Require light</span><span class="named-paragraph-number">10.4</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><a href="4-as.html#SP3" class="function-link"><span class="function-syntax">ActionSemantics::make_action_require_light</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">an_being_parsed</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-ap.html#SP10">&#167;10</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP10_5" class="paragraph-anchor"></a><b>&#167;10.5. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Set kind and access for an optional one</span><span class="named-paragraph-number">10.5</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><a href="4-as.html#SP3" class="function-link"><span class="function-syntax">ActionSemantics::give_action_an_optional_noun</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">an_being_parsed</span><span class="plain-syntax">, </span><span class="identifier-syntax">R</span><span class="plain-syntax">[1], </span><span class="identifier-syntax">RP</span><span class="plain-syntax">[1]);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-ap.html#SP10">&#167;10</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP10_6" class="paragraph-anchor"></a><b>&#167;10.6. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Set kind and access for one</span><span class="named-paragraph-number">10.6</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><a href="4-as.html#SP3" class="function-link"><span class="function-syntax">ActionSemantics::give_action_one_noun</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">an_being_parsed</span><span class="plain-syntax">, </span><span class="identifier-syntax">R</span><span class="plain-syntax">[1], </span><span class="identifier-syntax">RP</span><span class="plain-syntax">[1]);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-ap.html#SP10">&#167;10</a> (twice).</li></ul>
<p class="commentary firstcommentary"><a id="SP10_7" class="paragraph-anchor"></a><b>&#167;10.7. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Set kind and access for two</span><span class="named-paragraph-number">10.7</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><a href="4-as.html#SP3" class="function-link"><span class="function-syntax">ActionSemantics::give_action_two_nouns</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">an_being_parsed</span><span class="plain-syntax">, </span><span class="identifier-syntax">R</span><span class="plain-syntax">[1], </span><span class="identifier-syntax">RP</span><span class="plain-syntax">[1], </span><span class="identifier-syntax">R</span><span class="plain-syntax">[2], </span><span class="identifier-syntax">RP</span><span class="plain-syntax">[2]);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-ap.html#SP10">&#167;10</a> (four times).</li></ul>
<p class="commentary firstcommentary"><a id="SP10_8" class="paragraph-anchor"></a><b>&#167;10.8. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Set kind and access for one, doubling up</span><span class="named-paragraph-number">10.8</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><a href="4-as.html#SP3" class="function-link"><span class="function-syntax">ActionSemantics::give_action_two_nouns</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">an_being_parsed</span><span class="plain-syntax">, </span><span class="identifier-syntax">R</span><span class="plain-syntax">[1], </span><span class="identifier-syntax">RP</span><span class="plain-syntax">[1], </span><span class="identifier-syntax">R</span><span class="plain-syntax">[1], </span><span class="identifier-syntax">RP</span><span class="plain-syntax">[1]);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-ap.html#SP10">&#167;10</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP10_9" class="paragraph-anchor"></a><b>&#167;10.9. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Issue PM_ActionClauseUnknown problem</span><span class="named-paragraph-number">10.9</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">StandardProblems::sentence_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(),</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_ActionClauseUnknown</span><span class="plain-syntax">),</span>
<span class="plain-syntax">        </span><span class="string-syntax">"the action definition contained text I couldn't follow"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="string-syntax">"and may be too complicated."</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-ap.html#SP10">&#167;10</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP10_10" class="paragraph-anchor"></a><b>&#167;10.10. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Issue PM_ActionMisapplied problem</span><span class="named-paragraph-number">10.10</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">StandardProblems::sentence_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(),</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_ActionMisapplied</span><span class="plain-syntax">),</span>
<span class="plain-syntax">        </span><span class="string-syntax">"an action cannot apply to specific kinds of object such as 'room' or 'vehicle'"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="string-syntax">"and if it is going to apply to objects at all then it should talk about them "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"as 'things'. For example, 'Driving is an action applying to one touchable thing' "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"might be the way to set up an action for driving, even if it makes sense only "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"for a 'vehicle'. A rule like 'Check driving: if the noun is not a vehicle, ...' "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"would then be a good idea."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    ==&gt; { </span><span class="identifier-syntax">REQUIRES_ACCESS</span><span class="plain-syntax">, </span><span class="identifier-syntax">K_thing</span><span class="plain-syntax"> };</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-ap.html#SP10">&#167;10</a> and <a href="4-ap.html#SP10_11">&#167;10.11</a> (twice).</li></ul>
<p class="commentary firstcommentary"><a id="SP10_11" class="paragraph-anchor"></a><b>&#167;10.11. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Check action kind</span><span class="named-paragraph-number">10.11</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">A</span><span class="plain-syntax"> = </span><span class="identifier-syntax">R</span><span class="plain-syntax">[1]; </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K</span><span class="plain-syntax"> = </span><span class="identifier-syntax">RP</span><span class="plain-syntax">[1];</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">, </span><span class="identifier-syntax">K_thing</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">A</span><span class="plain-syntax"> == </span><span class="identifier-syntax">UNRESTRICTED_ACCESS</span><span class="plain-syntax">) </span><span class="identifier-syntax">A</span><span class="plain-syntax"> = </span><span class="identifier-syntax">REQUIRES_ACCESS</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        ==&gt; { </span><span class="identifier-syntax">A</span><span class="plain-syntax">, </span><span class="identifier-syntax">K_object</span><span class="plain-syntax"> };</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Kinds::Behaviour::is_subkind_of_object</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">)) &amp;&amp;</span>
<span class="plain-syntax">         (</span><span class="identifier-syntax">Latticework::super</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">) != </span><span class="identifier-syntax">K_object</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="4-ap.html#SP10_10" class="named-paragraph-link"><span class="named-paragraph">Issue PM_ActionMisapplied problem</span><span class="named-paragraph-number">10.10</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">A</span><span class="plain-syntax"> != </span><span class="identifier-syntax">UNRESTRICTED_ACCESS</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="4-ap.html#SP10_10" class="named-paragraph-link"><span class="named-paragraph">Issue PM_ActionMisapplied problem</span><span class="named-paragraph-number">10.10</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        ==&gt; { </span><span class="identifier-syntax">A</span><span class="plain-syntax">, </span><span class="identifier-syntax">K</span><span class="plain-syntax"> };</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="4-ap.html#SP10">&#167;10</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP11" class="paragraph-anchor"></a><b>&#167;11. </b>For years this was not erroneous, but you now can't write, say, "X is an
action applying to nothing, applying to nothing, requiring light and applying
to nothing".
</p>

<pre class="definitions code-font"><span class="definition-keyword">define</span> <span class="constant-syntax">OOW_ACT_CLAUSE</span><span class="plain-syntax"> </span><span class="constant-syntax">1</span>
<span class="definition-keyword">define</span> <span class="constant-syntax">PP_ACT_CLAUSE</span><span class="plain-syntax"> </span><span class="constant-syntax">2</span>
<span class="definition-keyword">define</span> <span class="constant-syntax">APPLYING_ACT_CLAUSE</span><span class="plain-syntax"> </span><span class="constant-syntax">3</span>
<span class="definition-keyword">define</span> <span class="constant-syntax">LIGHT_ACT_CLAUSE</span><span class="plain-syntax"> </span><span class="constant-syntax">4</span>
<span class="definition-keyword">define</span> <span class="constant-syntax">ABBREV_ACT_CLAUSE</span><span class="plain-syntax"> </span><span class="constant-syntax">5</span>
</pre>
<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">an_clauses_filled</span><span class="plain-syntax">[6];</span>
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">ActionsPlugin::clear_clauses</span><button class="popup" onclick="togglePopup('usagePopup6')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup6">Usage of <span class="code-font"><span class="function-syntax">ActionsPlugin::clear_clauses</span></span>:<br/><a href="4-ap.html#SP7_2">&#167;7.2</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">void</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax">=1; </span><span class="identifier-syntax">i</span><span class="plain-syntax">&lt;=5; </span><span class="identifier-syntax">i</span><span class="plain-syntax">++) </span><span class="identifier-syntax">an_clauses_filled</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">] = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">ActionsPlugin::clause</span><button class="popup" onclick="togglePopup('usagePopup7')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup7">Usage of <span class="code-font"><span class="function-syntax">ActionsPlugin::clause</span></span>:<br/><a href="4-ap.html#SP10">&#167;10</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">N</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">an_clauses_filled</span><span class="plain-syntax">[</span><span class="identifier-syntax">N</span><span class="plain-syntax">])</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">StandardProblems::sentence_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(),</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_ActionClauseRepeated</span><span class="plain-syntax">),</span>
<span class="plain-syntax">            </span><span class="string-syntax">"that seems to repeat a clause"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="string-syntax">"or to specify something twice over."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">an_clauses_filled</span><span class="plain-syntax">[</span><span class="identifier-syntax">N</span><span class="plain-syntax">] = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<nav role="progress"><div class="progresscontainer">
    <ul class="progressbar"><li class="progressprev"><a href="3-mhr.html">&#10094;</a></li><li class="progresschapter"><a href="P-wtmd.html">P</a></li><li class="progresschapter"><a href="1-im.html">1</a></li><li class="progresschapter"><a href="2-bd.html">2</a></li><li class="progresschapter"><a href="3-sm.html">3</a></li><li class="progresscurrentchapter">4</li><li class="progresscurrent">ap</li><li class="progresssection"><a href="4-anaa.html">anaa</a></li><li class="progresssection"><a href="4-ak.html">ak</a></li><li class="progresssection"><a href="4-ac.html">ac</a></li><li class="progresssection"><a href="4-act.html">act</a></li><li class="progresssection"><a href="4-as.html">as</a></li><li class="progresssection"><a href="4-av.html">av</a></li><li class="progresssection"><a href="4-ann.html">ann</a></li><li class="progresssection"><a href="4-ap2.html">ap2</a></li><li class="progresssection"><a href="4-anl.html">anl</a></li><li class="progresssection"><a href="4-apc.html">apc</a></li><li class="progresssection"><a href="4-pap.html">pap</a></li><li class="progresssection"><a href="4-pc.html">pc</a></li><li class="progresssection"><a href="4-ea.html">ea</a></li><li class="progresssection"><a href="4-nap.html">nap</a></li><li class="progresssection"><a href="4-gng.html">gng</a></li><li class="progresssection"><a href="4-rpoa.html">rpoa</a></li><li class="progresschapter"><a href="5-pp.html">5</a></li><li class="progresschapter"><a href="6-dlg.html">6</a></li><li class="progressnext"><a href="4-anaa.html">&#10095;</a></li></ul></div>
</nav><!-- End of weave -->

		</main>
	</body>
</html>

